package oldFiles;
/**
 * A behavior that make a car drive around randomly.
 *  
 * @author  Ole Caprani
 * @version 23.08.08
 */
public class Traveller extends PilotBehaviour 
{
    public Traveller( String name, int LCDrow, PilotBehaviour b)
    {
    	super(name, LCDrow, b);
    }
    	
    public void run()
    {    	
    	TravelVector goal = new TravelVector(200, 80);
    	super.travel(goal);
    	while (true)
    	{ 
    	   delay(2000);
    	   
	   		suppress();
    		
	   		super.stop();
	   		TravelVector tv = super.GetTravelledVector();
	    	   
    		TravelVector temp = new TravelVector(goal.getLength(), goal.getAngle());
    		temp.SubstractVector(tv);
    		
    		if ( temp.getLength() > 20 )
    		{
    			super.travel(temp);
    		}
    		else
    		{
    			super.stop();
    		}
	   		release();
    	   
    	   
    	   
    	}
    }
}
